package com.wyp168.leetcode;

import java.util.*;

/**
 * @ClassName NumMatchingSubseqSolution
 * @Title TODO
 * @Description TODO
 * @Author wyp168
 * @Date 2022/11/17 01:04
 */
public class NumMatchingSubseqSolution {
    public static void main(String[] args) {
        String[] words = {"ahjpjau","ja","ahbwzgqnuk","tnmlanowax"};
        String s = "dsahjpjauf";
        NumMatchingSubseqSolution solution = new NumMatchingSubseqSolution();
        System.out.println(solution.numMatchingSubseq(s, words));
    }

    public int numMatchingSubseq(String s, String[] words) {
        List<Integer>[] pos = new List[26];

        //初始化集合
        for (int i = 0; i < 26; i++) {
            pos[i] = new ArrayList<>();
        }
        for (int i = 0; i < s.length(); i ++) {
            pos[s.charAt(i) - 'a'].add(i);
        }

        int res = words.length;

        for (String word : words) {
            if (word.length() > s.length()) {
                res --;
                continue;
            }
            int p = -1;
            for (int i = 0; i < word.length(); i ++) {

            }
        }
        //TODO
        return 0;



    }

    public boolean isSubseq(String s, String target) {
        int index = -1;
        for (int i = 0; i < target.length(); i++) {
            if (s.length() == 0) {
                return false;
            }
            if ((index = s.indexOf(String.valueOf(target.charAt(i)))) != -1) {
                s = s.substring(index + 1);
                continue;
            }
            return false;
        }
        return true;
    }
}
